import {$post,$postParms} from '@/utils/require'
import {message} from "ant-design-vue";

export enum UserApi{
    list = "/user/findUserDTOPage",
    test="/user/test",
    edit='/user/edit',
    register='/user/register',
    insertOne='/user/insertOne',
    delOne='/user/delOne',
    delBatch="/user/delBatch",
    resetPassword='/user/resetPassword',
    getById='/user/getById'
}

export const $userList = async (body?:any, params?: any) => {
    try{
        return await $postParms(UserApi.list,body, params);
    }catch (error){
        console.error(error)
    }
}
export const $userInsertOne =async (body?:any, params?:any)=>{
    try{
        return await $postParms(UserApi.insertOne,body, params);
    }catch (error){
        console.error(error)
    }
}
export const $userEdit =async (body?:any, params?:any)=>{
    try{
        return await $postParms(UserApi.edit,body, params);
    }catch (error){
        console.error(error)
    }
}
export const userDelBatch =async (body?:any, params?:any)=>{
    try{
        return await $postParms(UserApi.delOne,body, params);
    }catch (error){
        console.error(error)
    }
}
/**
 * 重置密码
 */
export const userResetPassword =async (body?:any, params?:any)=>{
    try{
        return await $postParms(UserApi.resetPassword,body, params);
    }catch (error){
        console.error(error)
    }
}
/**
 * 查询单个用户
 */
export const $userGetById =async (body?:any, params?:any)=>{
    try{
        return await $postParms(UserApi.getById,body, params);
    }catch (error){
        console.error(error)
    }
}